
  //获取时间
export const Time = (time: { getDate: () => any; getUTCFullYear: () => any; getHours: () => any; getMonth: () => number; getMinutes: () => any; getSeconds: () => any; }, search?: boolean) => {
    const date = time.getDate()  < 10 ? '0' + time.getDate() : time.getDate()
    const year = time.getUTCFullYear()
    const hours = time.getHours()  < 10 ? '0' + time.getHours() : time.getHours()
  const month = time.getMonth() + 1 < 10 ? "0" + (time.getMonth() + 1) : time.getMonth() + 1;
    const minutes = time.getMinutes()  < 10 ? '0' + time.getMinutes() : time.getMinutes()
    const seconds = time.getSeconds()  < 10 ? '0' + time.getSeconds() : time.getSeconds()
    const a = [year, month, date].join('-')
    const b = [hours, minutes, seconds].join(":")
    if (search === true) { return a }
    return [a, b].join(' ')

  }
